<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;

class Goods extends Model
{
    use Searchable;
    /**
     * 获取模型的索引名称.
     *
     * @return string
     */
    public function searchableAs() {
        return 'goods_index';
    }

    /**
     * 获取模型的索引数据数组
     *
     * @return array
     */
    public function toSearchableArray() {
        $array = $this->toArray(); // 自定义数组...
        return $array;
    }
}
